/**
 * 通用工具类
 */
export class ComUtil {

    /**
    * 枚举双向映射(cocos里字符串的enum不会双向映射所以搞了这么个方法)
    * @param e 
    */
     static enumMapKey(e: any) {
        for (let key in e) {
            e[e[key]] = key;
        }
    }

    /**
     * 原型链继承
     * @param thisCls 
     * @param extendsCls
     */
    static prototypeExtends(thisCls: any, extendsCls: any) {
        let keys = Object.getOwnPropertyNames(extendsCls.prototype);
        for (let key of keys) {
            if (key === "constructor") continue;
            thisCls.prototype[key] = extendsCls.prototype[key];
        }
    }

}

export type ObjVal<T> = T[keyof T];